package com.lazycat.backend.controller.store;

import com.lazycat.backend.service.impl.store.OpenStoreServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class OpenStoreController {
    @Autowired
    private OpenStoreServiceImpl openStoreService;

    @PostMapping("store/open/")
    public void open(@RequestBody Map<String, String> map) {
        Integer userId = Integer.parseInt(map.get("user_id"));
        String storeName = map.get("store_name");
        openStoreService.open(userId, storeName);
    }
}
